package com.pkk.cloud.support.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pkk.cloud.support.admin.bo.RoleClientCateAndMenuResourceSimpeBo;
import com.pkk.cloud.support.admin.bo.RoleClientResourceSimpeBo;
import com.pkk.cloud.support.admin.dto.req.resources.OauthResourceIdReqDto;
import com.pkk.cloud.support.admin.dto.req.resources.OauthResourcePidReqDto;
import com.pkk.cloud.support.admin.dto.req.resources.OauthResourceRoleBindReqData;
import com.pkk.cloud.support.admin.dto.req.resources.OauthResourceUpdateIdReqDto;
import com.pkk.cloud.support.admin.dto.req.resources.OauthServerClientAllResourceSimpleReqDto;
import com.pkk.cloud.support.admin.dto.resp.resources.OauthResourceSimpleRespDto;
import com.pkk.cloud.support.admin.dto.resp.server.OauthServerClientSimpleRespDto;
import com.pkk.cloud.support.admin.entity.resource.PenguinSysResource;
import com.pkk.cloud.support.common.admin.dto.req.resource.SysResourceMenuReqDto;
import com.pkk.cloud.support.common.admin.dto.resp.resource.ServerMenuRespDto;
import java.util.List;
import java.util.Set;

/**
 * @author peikunkun<br>
 * @version V1.0<br>
 * @Title: 系统资源的接口<br>
 * @Description: <><br>
 * @date 2020/3/16 0016 下午 5:50<br>
 * @URL:[]
 */
public interface PenguinSysResourceService extends IService<PenguinSysResource> {


  /**
   * @Description: 获取处理之后的菜单信息
   * @Param: body
   * @return: java.util.List<com.pkk.cloud.support.admin.common.dto.resp.resource.SysResourceMenuRespDto>
   * @Author: peikunkun
   * @Date: 2020/3/16 0016 下午 5:51
   */
  ServerMenuRespDto getClientMenusByServerId(SysResourceMenuReqDto body, Long userId);

  /**
   * @Description: 依据服务名称获取资源信息
   * @Param: serverName:服务名称
   * @return: java.util.List<com.pkk.cloud.support.admin.entity.resource.PenguinSysResource>
   * @Author: peikunkun
   * @Date: 2020/3/16 0016 下午 5:53
   */
  List<PenguinSysResource> findSysResourceByServerName(String serverName, Long userId);

  /**
   * @Description: 根据服务查询按钮资源
   * @Param: serverId
   * @Param userId
   * @return: java.util.List<java.lang.String>
   * @Author: peikunkun
   * @Date: 2020/3/26 0026 下午 2:24
   */
  List<String> findSysResourceButtonByServerName(String serverId, Long userId);

  /**
   * @Description: 依据客户端id查询客户端资源信息
   * @Param: clientId
   * @return: java.util.List<com.pkk.cloud.support.admin.bo.RoleClientResourceSimpeBo>
   * @Author: peikunkun
   * @Date: 2020/4/10 0010 上午 11:18
   */
  List<RoleClientResourceSimpeBo> findClientAllResourceByClientId(String clientId);

  /**
   * @Description: 依据客户端id查询客户端资源信息[获取菜单与分类]
   * @Param: clientId
   * @return: java.util.List<com.pkk.cloud.support.admin.bo.RoleClientResourceSimpeBo>
   * @Author: peikunkun
   * @Date: 2020/4/10 0010 上午 11:18
   */
  List<RoleClientCateAndMenuResourceSimpeBo> findClientCateAndMenuResourceByClientId(String clientId);

  /**
   * @Description: 获取角色id查询角色资源id
   * @Param: roleId
   * @Author: peikunkun
   * @Date: 2020/4/10 0010 上午 11:40
   */
  Set<Long> findRoleResourceIdByRoleId(Long roleId);

  /**
   * @Description: 绑定资源与角色的关系
   * @Param: body
   * @return: boolean
   * @Author: peikunkun
   * @Date: 2020/4/11 0011 下午 12:41
   */
  boolean bindResourceRole(OauthResourceRoleBindReqData body);

  /**
   * @Description: 获取所有菜单-包括服务/资源/按钮
   * @Param: body
   * @return: java.util.List<com.pkk.cloud.support.admin.dto.resp.server.OauthServerClientAllResourceSimpleRespDto>
   * @Author: peikunkun
   * @Date: 2020/4/11 0011 下午 1:27
   */
  List<OauthServerClientSimpleRespDto> getServerClientAllResource(
      OauthServerClientAllResourceSimpleReqDto body);


  /**
   * @Description: 获取资源信息依据父id
   * @Param: request
   * @Author: peikunkun
   * @Date: 2020/4/11 0011 下午 7:41
   */
  List<OauthResourceSimpleRespDto> getResourceByPid(OauthResourcePidReqDto body);

  /**
   * @Description: 添加资源信息
   * @Param: penguinSysResource
   * @Param userId
   * @return: boolean
   * @Author: peikunkun
   * @Date: 2020/4/18 0018 下午 3:13
   */
  boolean addResource(List<PenguinSysResource> penguinSysResource, String userId);

  /**
   * @Description: 获取资源信息
   * @Param: body
   * @return: com.pkk.cloud.support.admin.dto.resp.resources.OauthResourceSimpleRespDto
   * @Author: peikunkun
   * @Date: 2020/4/18 0018 下午 3:45
   */
  OauthResourceSimpleRespDto getResourceById(Long resourceId);

  /**
   * @Description: 删除资源信息
   * @Param: request
   * @return: com.pkk.components.rpc.response.CommonResponse<java.lang.Boolean>
   * @Author: peikunkun
   * @Date: 2020/4/21 0021 下午 3:31
   */
  Boolean delResourceById(OauthResourceIdReqDto body, String userId);

  /**
   * @Description: 更新资源依据id
   * @Param: request
   * @return: com.pkk.components.rpc.response.CommonResponse<java.lang.Boolean>
   * @Author: peikunkun
   * @Date: 2020/4/21 0021 下午 4:05
   */
  Boolean updateResourceById(OauthResourceUpdateIdReqDto body, String userId);
}
